package com.asset.dispoal.company.service;

import com.asset.dispoal.company.api.CompanyQueryService;
import com.asset.dispoal.company.dto.CompanyAreaStatisticsRequest;
import com.asset.dispoal.company.dto.CompanyAreaStatisticsResponse;
import com.asset.dispoal.company.dto.CompanyRequest;
import com.asset.dispoal.company.dto.CompanyResponse;
import com.asset.dispoal.company.dto.CompanySelectResponse;
import com.asset.dispoal.company.dto.CompanySelected;
import com.asset.dispoal.company.dto.PlaintiffCourtRequest;
import com.asset.dispoal.company.service.commom.CompanyCourtCommand;
import com.asset.dispoal.company.service.commom.CompanyPageCommand;
import com.asset.dispoal.company.service.commom.FindTreeCommand;
import com.asset.dispoal.company.service.commom.QueryCompanyStatisticsCommand;
import com.asset.dispoal.company.service.commom.QueryCourtByPlaintiffIdCommand;
import com.asset.dispoal.company.service.commom.QueryCourtSelectedCommand;
import com.asset.dispoal.company.service.commom.QueryLawFirmSelectedCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

import java.util.List;

/**
 * @author qr
 * @date 2022/2/15$
 */
@Service
public class CompanyQueryServiceImpl implements CompanyQueryService {

    @Autowired
    FindTreeCommand findTreeCommand;

    @Autowired
    CompanyPageCommand companyPageCommand;

    @Autowired
    CompanyCourtCommand companyCourtCommand;

    @Autowired
    QueryCourtByPlaintiffIdCommand queryCourtByPlaintiffIdCommand;

    @Autowired
    QueryLawFirmSelectedCommand queryLawFirmSelectedCommand;

    @Autowired
    QueryCourtSelectedCommand queryCourtSelectedCommand;

    @Autowired
    QueryCompanyStatisticsCommand queryCompanyStatisticsCommand;


    @Override
    public Result<List<CompanyResponse>> findTree(CompanyRequest companyRequest) {
        return findTreeCommand.execute(companyRequest);
    }

    @Override
    public Result<PageVO<CompanyResponse>> queryPage(CompanyRequest companyRequest) {
        return companyPageCommand.execute(companyRequest);
    }

    @Override
    public Result<List<CompanySelectResponse>> queryCourtByPlaintiffId(PlaintiffCourtRequest request) {
        return queryCourtByPlaintiffIdCommand.execute(request);
    }

    @Override
    public Result<List<CompanySelected>> queryLawFirmSelectedCourt(String lawFirmId) {
        return queryLawFirmSelectedCommand.execute(lawFirmId);
    }

    @Override
    public Result<List<CompanySelected>> queryCourtSelectedCourt(String courtId) {
        return queryCourtSelectedCommand.execute(courtId);
    }

    @Override
    public Result<List<CompanyAreaStatisticsResponse>> queryStatistics(CompanyAreaStatisticsRequest request) {
        return queryCompanyStatisticsCommand.execute(request);
    }

    @Override
    public Result<List<CompanyResponse>> companyCourtList() {
        return companyCourtCommand.execute();
    }
}
